layui.define([ 'form', 'laydate', 'table','ruleApi'], function(exports) {
	var form = layui.form;
	var ruleApi = layui.ruleApi;
	var index = layui.index;
	var view = {
			init:function(){
				Lib.initGenrealForm($("#updateForm"),form);
				this.initSubmit();
			},
			initSubmit:function(){
				$("#scoreRule").click(function(){
					
					var loginScore = $("input[name='loginScore']").val();
                    var directScore = $("input[name='directScore']").val();
                    var indirectScore = $("input[name='indirectScore']").val();

					if(loginScore<=0 ){
                        Common.info("注册透镜分必须大于0，且为整数");
                        return;
					}
                    if(directScore<=0){
                        Common.info("直荐透镜分必须大于0，且为整数");
                        return;
                    }
                    if(indirectScore<=0){
                        Common.info("转荐透镜分必须大于0，且为整数");
                        return;
                    }
                    ruleApi.updateRule($('#updateForm'),function(){
                        parent.window.dataReload();
                        Common.info("配置成功");
                        Lib.closeFrame();
                    });
					
					
				});
				
				$("#rechargeOrder-cancel").click(function(){
					Lib.closeFrame();
				});
			}
				
	}
	
	
	
	 exports('edit',view);
	
});